#!/usr/bin/env python3
# coding:utf-8
import time
import asyncio
import aiomqtt

async def main():
    async with aiomqtt.Client('127.0.0.1') as client:
        msgs = ["12345678","abcdef", "hello world", 8899, 3.14]
        for msg in msgs:
            await client.publish('test/topic1',payload=msg)
            await client.publish('test/topic2',payload=msg)
            time.sleep(2)
        
if __name__ == '__main__':
    asyncio.run(main())